"use strict"
const { createClient } = require("oicq")


const account = 1492762573

const bot = createClient(account, { platform: 'iPad' })

bot
	.on("system.login.qrcode", function (e) {
		this.logger.mark("扫码后按Enter完成登录")
		process.stdin.once("data", () => {
			this.login()
		})
	})
	.login()
// bot
// 	.on("system.login.slider", function (e) {
// 		console.log(e)
// 		process.stdin.once("data", (ticket) => {
// 			this.submitSlider(String(ticket).trim())
// 		})
// 	})
// 	.login(password)

exports.bot = bot

// template plugins
require("./plugins/plugin-hello") //hello world
require("./plugins/plugin-image") //发送图文和表情
require("./plugins/plugin-request") //加群和好友
require("./plugins/plugin-online") //监听上线事件
require('./plugins/plugin-myGroup') //监听自定义群组
require('./plugins/plugin-privateMsg') //自定义私聊

process.on("unhandledRejection", (reason, promise) => {
	console.log('Unhandled Rejection at:', promise, 'reason:', reason)
})
